    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.SQLWarning;
    
    final static String driverClass    = "com.mysql.jdbc.Driver";
    final static String connectionURL  = "jdbc:mysql://localhost";
    final static String userID         = "tlee";
    final static String userPassword   = "test1234";
    java.sql.Connection   con                   = null;


    try {

        System.out.print("  Loading JDBC Driver  -> " + driverClass + "\n");
        Class.forName(driverClass).newInstance();
        
        System.out.print("  Connecting to        -> " + connectionURL + "\n");
        con = DriverManager.getConnection(connectionURL, userID, userPassword);
        System.out.print("  Connected as         -> " + userID + "\n");

        DatabaseMetaData md = null;    
        md = con.getMetaData() 
        ResultSet rs =  md.getCatalogs();
        
         while (rs.next()) {
            String cat = rs.getString("TABLE_CAT");
            println cat
        }
    
         rs =  md.getSchemas();
        println 'schmeas'
         while (rs.next()) {
            String cat = rs.getString("TABLE_CAT");
            String sch = rs.getString("TABLE_SCHEM");
            println cat + " " + sch
        }
    
    
         ResultSet rs =  md.getExportedKeys();
        
    
   
 
       // ResultSet rset = md.getExportedKeys('meventa', 

    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (SQLException e) {
        e.printStackTrace();
    }


   

     



    try {
            System.out.print("  Closing Connection...\n");
            con.close();
            
        } catch (SQLException e) {
        
            e.printStackTrace();
            
        }
